<script setup>
import { get } from '@/net'
import { ElMessage } from 'element-plus'
import router from '@/router'
import { useStore } from '@/stores/counter'
const store = useStore()

const logout = () => {
  get('/api/auth/logout', (message) => {
    ElMessage.success(message)
    store.auth.useStore = null
    router.push('/')
  })
}
</script>

<template>
  <div>欢迎进入</div>
  <div>
    <el-button type="danger" plain @click="logout">退出登录</el-button>
  </div>
</template>

<style scoped></style>
